<div class='yui-g'>
    <div class='yui-u first'>
        <h3>Categories</h3>

        <div id='add_new_cat'>
            <input type='text' name='new_category' id='new_category' size='30'> 
            <?php echo  button_tag('Add',array('onclick'=>'add_new_category();')) ?>

        </div>
        <div id='news_categories'>
        <?php 
        foreach($news_categories->categories_as_list() as $k=>$v) {
            if ( in_array($k, $news_item_categories) )
            {
                $checked = true;            
            } else {
                $checked = false;
            }  
            echo "<label for='c_{$k}'>".check_box_tag('news[categories][]',$k,$checked,array('id'=>"c_{$k}"))." $v</label>";
        }                                        
        ?>
    </div>
</div>
<div class='yui-u'>
    <h3>Timestamp</h3>                
    <p>If edit timestamp is checked, you can change the posted date for your story.</p>
    <label for="edit_timestamp"><?php echo  check_box_tag('edit_timestamp',1,false,array('id'=>'edit_timestamp')) ?> Edit timestamp?</label>
    <?php 
    if($news->is_loaded()){
        $news_publish_date = date_to_getdate($news->get('publish_date'));
    } else {
        $news_publish_date = array();
    }
    ?>
    <?php echo  select_date($news_publish_date, array('use_month_names'=>true)) ?>
    @ <?php echo  select_time($news_publish_date) ?>

    <script type="text/javascript" charset="utf-8">
    // make sure the checkbox is ticked
    $$('#timestamp select').each(function(sElm){
        sElm.onchange = function(){
            $('edit_timestamp').checked = 'checked';
        }
    });
    </script>
</div>      
</div>